/**
 * @fileoverview Tests for no-with rule.
 * @author Nicholas C. Zakas
 */

 "use strict";

 //------------------------------------------------------------------------------
 // Requirements
 //------------------------------------------------------------------------------
 
 var rule = require("../../../lib/rules/no-call-cb"),
     { RuleTester } = require('eslint');
 
 //------------------------------------------------------------------------------
 // Tests
 //------------------------------------------------------------------------------
 
 var ruleTester = new RuleTester();
 ruleTester.run("no-call-cb-test", rule, {
     valid: [
      "function foo(a, cb) { cb(a) };",
     ],
     invalid: [
         {
            code: `function foo(a, cb) { return a; }`,
            errors: [{ message: "`cb` should be called in every path." }]
         }
     ]
 });